class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int dest = -1, cur = 0; // 双指针
        for(; cur < nums.size(); ++cur)
        {
            if(nums[cur] != 0)
            {
                dest++;
                swap(nums[dest], nums[cur]);
            }
        } 
    }
};